package com.jye.cloud.user.controller;

import com.jye.cloud.domain.Follow;
import com.jye.cloud.domain.JsonResult;
import com.jye.cloud.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/follow")
public class FollowNacosController {

    @Value("${server-url.cloud-provider-user}")
    private String serverUrl;

    @Autowired
    private RestTemplate restTemplate;

    @PostMapping("/doCoursesFollow")
    public JsonResult doCoursesFollow(Follow follow){
        return restTemplate.postForObject(serverUrl+"/follow/doCoursesFollow",follow,JsonResult.class);
    }

}
